import pytest
import requests
from send.Send import Send
from utils.read_yaml import read_yaml


class Test_loan:

    @pytest.mark.parametrize( "args", read_yaml("D:/Projects/接口自动化/data/loan.yaml")  )
    def  test_loan(self,args):
        se = Send()
        login_username = args["username"]
        session = se.ceshi_buy_login(login_username)
        exp = args["exp"]

        result = se.send_loan(session,args)
        assert result["code"] == 200 and result["body"]["code"] == exp